
package game.view {
	import common.IRender;
	import common.debug.Debug;
	
	import flash.display.Sprite;
	
	import game.manager.RendererManager;
	import game.model.vo.SceneVO;
	import game.view.scene.MapLayer;
	
	/**
	 * SceneView
	 *
	 * @author chris
	 *
	 * Apr 19, 2013
	 */
	public class SceneView extends Sprite implements IRender {
		//地图层
		private var mapLayer:Sprite;
		//npc层
		private var npcLayer:Sprite;
		//物件层
		private var widgetLayer:Sprite;
		//特效层
		private var effectLayer:Sprite;
		
		private var map:MapLayer;
		
		private var vo:SceneVO;
		
		public function SceneView()
		{
			super();
			RendererManager.inst.addItem(this);
			
			map = new MapLayer();
			mapLayer = new Sprite();
			mapLayer.addChild(map);
			this.addChild(mapLayer);
			
			npcLayer = new Sprite();
			this.addChild(npcLayer);
			widgetLayer = new Sprite();
			this.addChild(widgetLayer);
			effectLayer = new Sprite();
			this.addChild(effectLayer);
		}
		
		public function buildScene(sceneVO:SceneVO):void {
			this.vo = sceneVO;
			map.init(sceneVO);
		}
		
		public function frameScript():void {
			map.frameScript();
		}
	}
}